 print("hotfix start")

 --[[
 local obj = snax.self()

 snax.hotfix(obj, 

 local command 
 local hello
 local skynet
 function Get_Test(h)
     return "ddddddd"
 end

 function response.ping(lhello)
     skynet.sleep(100)
     return Get_Test("ffff")
 end

 function hotfix(...)
     print("3333")
     return "d"
 end


 --]]
 local function get_up(f)
     local u = {}
     if not f then
         return u
     end
     local i = 1
     while true do
         local name, value = debug.getupvalue(f, i)
         if name == nil then
             return u
         end
         print("name="..name.." value:"..tostring(value))
         u[name] = value
         i = i + 1
     end
     return u
 end

 local function get_local( func, name )  
      local i=1  
      local v_name, value  
      while true do 
          v_name, value = debug.getlocal(func,i)  
          if not v_name or v_name == name then  
              break  
          end  
          print(""..v_name.."  "..i)
          i = i+1  
      end  
      if v_name and v_name == name then  
          return value  
      end  
      return nil  
  end  
  local function set_local( func, name, value )  
     local i=1  
     local v_name  
     while true do  
         v_name, _ = debug.getlocal(func,i)  
         if not v_name or v_name == name then  
             break  
         end  
         i = i+1  
     end  
     if not v_name then  
         return false 
     end 
     debug.setlocal(func,i,value)
     return true  
 end

print("1111111111111111111111111")
local temp =  get_up(_G.Get_Test, "command")
if temp then
   print("temp = "..tostring(temp))
   print("table = "..tostring(temp["command"]))
end


print("2 111111111111111111111111")
local command = temp["command"]
_G.Get_Test = function(h) 
    return command.update(h)
end

print("3 111111111111111111111111")

print(tostring(set_local(_G.Get_Test, "command", temp["command"])))

print("4 444444444444444 ")


